package com.eastidea.live.field.pagebreak;

import net.sf.json.JSONObject;

import com.eastidea.live.entity.FrmUiField;
import com.eastidea.live.entity.FrmUiForm;
import com.eastidea.live.ot.FieldOt;

public class PageBreakOt {
	public static PageBreakTo GeneratePageBreakTo(FrmUiField po, FrmUiForm form) {
		Long id = form.getId() > 0? po.getId(): 0;
		
		PageBreakTo to = new PageBreakTo();
		to.setId(id);
		to.setUid(po.getUid());		
		
		to.setCode(po.getCode());
		to.setIndexx(po.getIndexx());	
		to.setStatus(po.getStatus());
		return to;
	}
	
	public static FrmUiField GeneratePageBreakPo(JSONObject obj) {
		FrmUiField po = new FrmUiField();		
		FieldOt.setUiElementProperties(po, obj);
		return po;
	}
}
